﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Department.aspx.cs" Inherits="InformationSystem.WebSite.Module.AuthorityMgr.Department" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script type="text/javascript">
        function callback() {
            parent.ResizeFrameHeight(GridPanel1.getHeight());
            //parent.ResizeFrameHeight(ViewPort1.getHeight(500));
        }
    </script>
    <ext:XScript ID="XScript1" runat="server">
        <script type="text/javascript">
            function AfterEdit() {
                GridPanel1.save();
            }
        </script>
    </ext:XScript>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server">
        <Listeners>
            <DocumentReady Fn="callback()" />
        </Listeners>
    </ext:ResourceManager>
    <ext:GridPanel ID="GridPanel1" runat="server" Height="380" Title="院系信息" Layout="ContainerLayout">
        <Store>
            <ext:Store ID="CollegeStore" runat="server" RemoteSort="true" OnBeforeRecordUpdated="BeforeRecordUpdated" OnAfterStoreChanged="AfterStoreChanged">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="collegeid" Mapping="CollegeId" Type="Int" />
                            <ext:RecordField Name="collegeName" Mapping="CollegeName" Type="String" />
                            <ext:RecordField Name="ispublicdept" Mapping="IsPublicDept" Type="Boolean" />
                            <ext:RecordField Name="userforum" Mapping="UserForum" Type="Boolean" />
                            <ext:RecordField Name="forumStatus" Mapping="ForumStatusDescp" Type="String" />
                            <ext:RecordField Name="forumpublictoAll" Mapping="ForumPublicToAll" Type="Boolean" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
        </Store>
        <Plugins>
            <ext:RowEditor ID="RowEditor1" runat="server" SaveText="保存" CancelText="取消" ErrorSummary="false" CommitChangesText="请先保存或取消当前操作" ErrorText="错误">
                <Listeners>
                    <AfterEdit Handler="AfterEdit()" />
                </Listeners>
            </ext:RowEditor>
        </Plugins>
        <View>
            <ext:GridView ID="GridView1" runat="server" MarkDirty="false" />
        </View>
        <BottomBar>
            <ext:StatusBar ID="StatusBar1" runat="server" Text="双击记录进行编辑">
            </ext:StatusBar>
        </BottomBar>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
        </SelectionModel>
        <ColumnModel>
            <Columns>
                <ext:Column ColumnID="collegeName" Header="院系名称" DataIndex="collegeName" Width="180">
                </ext:Column>
                <ext:BooleanColumn ColumnID="ispublicdept" Header="是否公共部门" DataIndex="ispublicdept"
                    Align="Center" Width="90" TrueText="是" FalseText="否">
                    <Editor>
                        <ext:Checkbox ID="Checkbox1" runat="server">
                        </ext:Checkbox>
                    </Editor>
                    <PrepareCommand />
                </ext:BooleanColumn>
                <ext:BooleanColumn ColumnID="userforum" Header="是否使用论坛" DataIndex="userforum" Align="Center"
                    Width="90" TrueText="是" FalseText="否">
                    <Editor>
                        <ext:Checkbox ID="Checkbox2" runat="server">
                        </ext:Checkbox>
                    </Editor>
                    <PrepareCommand />
                </ext:BooleanColumn>
                <ext:Column ColumnID="forumStatus" Header="论坛当前状态" DataIndex="forumStatus" Width="90">
                    <Editor>
                        <ext:ComboBox ID="ComboBox1" runat="server" AllowBlank="true">
                            <Items>
                                <ext:ListItem Text="正常" />
                                <ext:ListItem Text="关闭" />
                            </Items>
                        </ext:ComboBox>
                    </Editor>
                </ext:Column>
                <ext:BooleanColumn ColumnID="forumpublictoAll" Header="论坛是否全校公开" DataIndex="forumpublictoAll"
                    Align="Center" Width="120" TrueText="是" FalseText="否">
                    <Editor>
                        <ext:Checkbox ID="Checkbox3" runat="server">
                        </ext:Checkbox>
                    </Editor>
                </ext:BooleanColumn>
            </Columns>
        </ColumnModel>
        <Listeners>
        </Listeners>
    </ext:GridPanel>
    </form>
</body>
</html>
